package com.sqm.a4;

import edu.princeton.cs.algs4.StdOut;

/**
 * @Author sun.qingmeng
 * @Date 2021/2/10 10:34 下午
 */
public class Ex_1_1_7 {
    public static void main(String[] args) {
        double t = 9.0;
        System.out.println((t - 9.0));
        t = (0.9 / t + t) / 2.0;
        System.out.println(t);


//        while (Math.abs(t - 9.0 / t) > 0.001) {
//            t = (0.9 / t + t) / 2.0;
//            System.out.println(Math.abs(t - 9.0));
//            StdOut.printf("%.5f\n", t);
//        }

    }
}
